package com.wlf.demo.mp.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wlf.demo.mp.entity.User;
import com.wlf.demo.mp.service.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wan Email-wlf18726994755@163.com
 * @version 1.0
 * @className UserCustomController
 * @date 2020/6/5 14:58
 **/
@RestController
@RequestMapping("/userCustom")
public class UserCustomController {
    @Resource
    private IUserService iUserService;

    /**
     * 查询分数大于80
     * @return 分页数据
     */
    @GetMapping("/getUserListSql")
    public IPage<User> getUserListSql() {
        IPage<User> page = new Page<>();
        page.setCurrent(1);
        page.setSize(2);
        return iUserService.selectUserByFraction(page, 80L);
    }

}
